import cv2

if __name__ == '__main__':
    # 创建窗口
    cv2.namedWindow('mywindow', cv2.WINDOW_NORMAL)
    # 设置窗口大小
    cv2.resizeWindow('mywindow', 500, 500)
    # 显示窗口
    cv2.imshow('mywindow', 0)

    key = cv2.waitKey(0)
    if key == ord('q'):
        # 关闭窗口
        cv2.destroyAllWindows()
